package com.apes.fn.server.workDesk.model;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * @program: apes-server
 * @description:
 * @author: czs
 * @create: 2022-07-27 15:24
 **/
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = WorkDeskConfig.CONST_TABLE_NAME)
public class WorkDeskConfig extends Model {
    public static final String CONST_TABLE_NAME = "WORK_DESK_CONFIG";

    @Id
    @Column(name = "id", nullable = false, length = 24)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "工作台配置参数编码", padding = 12)
    private String id;

    @Column(name = "name", length = 64)
    @Comment("名称")
    private String name;

    @Column(name = "old", length = 64)
    @Comment("旧物")
    private String old;

    @Column(name = "data", length = 64)
    @Comment("数据")
    private String data;

    @Column(name = "type", length = 64)
    @Comment("类型")
    private String type;

    @Column(name = "other", length = 64)
    @Comment("其他")
    private String other;

    @Column(name = "valid", nullable = false, columnDefinition = "number(1,0) default 1")
    @Comment("有效标记")
    private boolean valid = true; //有效

    @Column(name = "api", length = 128)
    @Comment("接口")
    private String api;

    @Column(name = "COUNT_API", length = 128)
    @Comment("统计接口")
    private String countApi;
}
